<?php
//yang dipanggil oleh semua halaman, ini dijadikan helper auto load
if (!function_exists('rightfooter')) {
    function rightfooter() {
        $CI = & get_instance();
        $CI->load->database();
        
        $sql = 'SELECT judul, slug FROM konten_statis
        WHERE id_konten_statis = 6 OR id_konten_statis = 7 OR id_konten_statis = 8';
        $CI->db->cache_on();
        $query = $CI->db->query($sql);
        if ($query->num_rows() > 0) {
            $result = $query->result_array();            
            $query->free_result();
        } else {
            $result = array();
        }

        echo '<span class="pull-right leftfooter">';
            foreach ($result as $link){
              echo '<a href="' . site_url($link['slug']) . '" title=" ' .$link['judul'] . '"> ' . $link['judul'] . ' </a>';
            }
        echo '</span>';
    }
}

if (!function_exists('leftfooter')) {
    function leftfooter() {
        $CI = & get_instance();
        $CI->load->database();
        
        $sql = 'SELECT konten FROM konten_statis WHERE id_konten_statis = 9';
        $CI->db->cache_on();
        $query = $CI->db->query($sql);
        if ($query->num_rows() > 0) {
            $result = $query->row_array();            
            $query->free_result();
        } else {
            $result = array();
        }

        $value = strip_tags($result['konten']);
        return $value;
    }
}